﻿/*
-----------------------------------------------------------------------------
This source file is part of Cell Cloud.

Copyright (c) 2009-2012 Cell Cloud Team - cellcloudproject@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/

#ifndef CellAdapter_h
#define CellAdapter_h

#include "CellPrerequisites.h"

namespace cell
{
/** \addtogroup Core
 *  @{
 */
/** \addtogroup Adapter
 *  @{
 */

typedef void (*DLL_START_ADAPTER)(void);
typedef void (*DLL_STOP_ADAPTER)(void);

#define START_ADAPTER_SYMBOL "startAdapter"
#define STOP_ADAPTER_SYMBOL "stopAdapter"

/** 适配器接口。
@author
	Jiangwei Xu
*/
class _CellExport Adapter
{
public:
	/** 构造函数。
	*/
	Adapter(const String& name);

	/** 析构函数。
	*/
	virtual ~Adapter(void);

public:
	/** 返回适配器名称。
	*/
	const String& getName(void) const;

	/** 配置适配器。该方法由适配器管理器调用。
	*/
	virtual void setup(void) = 0;

	/** 拆卸适配器。该方法由适配器管理器调用。
	*/
	virtual void teardown(void) = 0;

private:
	String mName;	/// 适配器名称。
};

/** @} */
/** @} */
} // end namespace cell

#endif // CellAdapter_h
